package com.itheima.consumer.client;


import com.itheima.consumer.config.FeignConfig;
import com.itheima.consumer.client.fallback.UserClientFallBack;
import com.itheima.consumer.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//声明当前类是一个feign客户端，指定
@FeignClient(value = "user-service",fallback = UserClientFallBack.class,configuration = FeignConfig.class)
@Repository
public interface UserClient {

    @GetMapping("/user/{id}")
    User queryById(@PathVariable long id);
}
